function TbJxsh(params){ 
	 
}

TbJxsh.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new TbJxsh.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new TbJxsh.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new TbJxsh.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	/** 编号 [非空]       **/
	this.tbjId=function(tbjId){if(this.proxy)return this.getProxy().tbjId(tbjId);  this.put("tbjId", tbjId);return this;};
	/** and tbj_id is null */
	this.tbjIdNull=function(){if(this.proxy)return this.getProxy().tbjIdNull();if(this.get("tbjIdNot")==null)this.put("tbjIdNot", "");this.put("tbjId", null);return this;};
	/** not .... */
	this.tbjIdNot=function(){if(this.proxy)return this.getProxy().tbjIdNot();this.put("tbjIdNot", "not");return this;};
	this.tbjIdNotNull=function(){if(this.proxy)return this.getProxy().tbjIdNotNull();this.put("tbjIdNot", "not");this.put("tbjId", null);return this;};
	this.tbjIdNot=function(tbjId){if(this.proxy)return this.getProxy().tbjIdNot(tbjId);this.put("tbjIdNot", "not");this.put("tbjId", tbjId);return this;};
	/** and tbj_id <= ? */
	this.tbjIdMin=function(min){if(this.proxy)return this.getProxy().tbjIdMin(min);this.put("tbjIdMin", min);return this;};
	/** and tbj_id >= ? */
	this.tbjIdMax=function(max){if(this.proxy)return this.getProxy().tbjIdMax(max);this.put("tbjIdMax", max);return this;};
	this.tbjIdIn=function(ids){
		if(this.proxy)return this.getProxy().tbjIdIn(ids);  this.put("tbjIdIn", ids);return this;
	};	
	
	/** 品牌  [Merchant]      **/
	this.tbjBrand=function(tbjBrand){if(this.proxy)return this.getProxy().tbjBrand(tbjBrand);  this.put("tbjBrand", tbjBrand);return this;};
	/** and tbj_brand is null */
	this.tbjBrandNull=function(){if(this.proxy)return this.getProxy().tbjBrandNull();if(this.get("tbjBrandNot")==null)this.put("tbjBrandNot", "");this.put("tbjBrand", null);return this;};
	/** not .... */
	this.tbjBrandNot=function(){if(this.proxy)return this.getProxy().tbjBrandNot();this.put("tbjBrandNot", "not");return this;};
	this.tbjBrandNotNull=function(){if(this.proxy)return this.getProxy().tbjBrandNotNull();this.put("tbjBrandNot", "not");this.put("tbjBrand", null);return this;};
	this.tbjBrandNot=function(tbjBrand){if(this.proxy)return this.getProxy().tbjBrandNot(tbjBrand);this.put("tbjBrandNot", "not");this.put("tbjBrand", tbjBrand);return this;};
	this.tbjBrandIn=function(ids){
		if(this.proxy)return this.getProxy().tbjBrandIn(ids);  this.put("tbjBrandIn", ids);return this;
	};	
	
	/** 经销商名称        **/
	this.tbjName=function(tbjName){if(this.proxy)return this.getProxy().tbjName(tbjName);  this.put("tbjName", tbjName);return this;};
	/** and tbj_name is null */
	this.tbjNameNull=function(){if(this.proxy)return this.getProxy().tbjNameNull();if(this.get("tbjNameNot")==null)this.put("tbjNameNot", "");this.put("tbjName", null);return this;};
	/** not .... */
	this.tbjNameNot=function(){if(this.proxy)return this.getProxy().tbjNameNot();this.put("tbjNameNot", "not");return this;};
	this.tbjNameNotNull=function(){if(this.proxy)return this.getProxy().tbjNameNotNull();this.put("tbjNameNot", "not");this.put("tbjName", null);return this;};
	this.tbjNameNot=function(tbjName){if(this.proxy)return this.getProxy().tbjNameNot(tbjName);this.put("tbjNameNot", "not");this.put("tbjName", tbjName);return this;};
	
	/** 电话        **/
	this.tbjPhone=function(tbjPhone){if(this.proxy)return this.getProxy().tbjPhone(tbjPhone);  this.put("tbjPhone", tbjPhone);return this;};
	/** and tbj_phone is null */
	this.tbjPhoneNull=function(){if(this.proxy)return this.getProxy().tbjPhoneNull();if(this.get("tbjPhoneNot")==null)this.put("tbjPhoneNot", "");this.put("tbjPhone", null);return this;};
	/** not .... */
	this.tbjPhoneNot=function(){if(this.proxy)return this.getProxy().tbjPhoneNot();this.put("tbjPhoneNot", "not");return this;};
	this.tbjPhoneNotNull=function(){if(this.proxy)return this.getProxy().tbjPhoneNotNull();this.put("tbjPhoneNot", "not");this.put("tbjPhone", null);return this;};
	this.tbjPhoneNot=function(tbjPhone){if(this.proxy)return this.getProxy().tbjPhoneNot(tbjPhone);this.put("tbjPhoneNot", "not");this.put("tbjPhone", tbjPhone);return this;};
	
	/** 总收益        **/
	this.tbjProfit=function(tbjProfit){if(this.proxy)return this.getProxy().tbjProfit(tbjProfit);  this.put("tbjProfit", tbjProfit);return this;};
	/** and tbj_profit is null */
	this.tbjProfitNull=function(){if(this.proxy)return this.getProxy().tbjProfitNull();if(this.get("tbjProfitNot")==null)this.put("tbjProfitNot", "");this.put("tbjProfit", null);return this;};
	/** not .... */
	this.tbjProfitNot=function(){if(this.proxy)return this.getProxy().tbjProfitNot();this.put("tbjProfitNot", "not");return this;};
	this.tbjProfitNotNull=function(){if(this.proxy)return this.getProxy().tbjProfitNotNull();this.put("tbjProfitNot", "not");this.put("tbjProfit", null);return this;};
	this.tbjProfitNot=function(tbjProfit){if(this.proxy)return this.getProxy().tbjProfitNot(tbjProfit);this.put("tbjProfitNot", "not");this.put("tbjProfit", tbjProfit);return this;};
	/** and tbj_profit <= ? */
	this.tbjProfitMin=function(min){if(this.proxy)return this.getProxy().tbjProfitMin(min);this.put("tbjProfitMin", min);return this;};
	/** and tbj_profit >= ? */
	this.tbjProfitMax=function(max){if(this.proxy)return this.getProxy().tbjProfitMax(max);this.put("tbjProfitMax", max);return this;};
	
	/** 所在位置  [Region]      **/
	this.tbjLocation=function(tbjLocation){if(this.proxy)return this.getProxy().tbjLocation(tbjLocation);  this.put("tbjLocation", tbjLocation);return this;};
	/** and tbj_location is null */
	this.tbjLocationNull=function(){if(this.proxy)return this.getProxy().tbjLocationNull();if(this.get("tbjLocationNot")==null)this.put("tbjLocationNot", "");this.put("tbjLocation", null);return this;};
	/** not .... */
	this.tbjLocationNot=function(){if(this.proxy)return this.getProxy().tbjLocationNot();this.put("tbjLocationNot", "not");return this;};
	this.tbjLocationNotNull=function(){if(this.proxy)return this.getProxy().tbjLocationNotNull();this.put("tbjLocationNot", "not");this.put("tbjLocation", null);return this;};
	this.tbjLocationNot=function(tbjLocation){if(this.proxy)return this.getProxy().tbjLocationNot(tbjLocation);this.put("tbjLocationNot", "not");this.put("tbjLocation", tbjLocation);return this;};
	this.tbjLocationIn=function(ids){
		if(this.proxy)return this.getProxy().tbjLocationIn(ids);  this.put("tbjLocationIn", ids);return this;
	};	
	
	/** 添加时间        **/
	this.tbjAddTime=function(tbjAddTime){if(this.proxy)return this.getProxy().tbjAddTime(tbjAddTime);  this.put("tbjAddTime", tbjAddTime);return this;};
	/** and tbj_add_time is null */
	this.tbjAddTimeNull=function(){if(this.proxy)return this.getProxy().tbjAddTimeNull();if(this.get("tbjAddTimeNot")==null)this.put("tbjAddTimeNot", "");this.put("tbjAddTime", null);return this;};
	/** not .... */
	this.tbjAddTimeNot=function(){if(this.proxy)return this.getProxy().tbjAddTimeNot();this.put("tbjAddTimeNot", "not");return this;};
	this.tbjAddTimeNotNull=function(){if(this.proxy)return this.getProxy().tbjAddTimeNotNull();this.put("tbjAddTimeNot", "not");this.put("tbjAddTime", null);return this;};
	this.tbjAddTimeNot=function(tbjAddTime){if(this.proxy)return this.getProxy().tbjAddTimeNot(tbjAddTime);this.put("tbjAddTimeNot", "not");this.put("tbjAddTime", tbjAddTime);return this;};
	/** and tbj_add_time >= ? */
	this.tbjAddTimeStart=function(start){if(this.proxy)return this.getProxy().tbjAddTimeStart(start);this.put("tbjAddTimeStart", start);return this;};			
	/** and tbj_add_time <= ? */
	this.tbjAddTimeEnd=function(end){if(this.proxy)return this.getProxy().tbjAddTimeEnd(end);this.put("tbjAddTimeEnd", end);return this;};
	
	/** 状态    0:无效 1:有效     **/
	this.tbjStatus=function(tbjStatus){if(this.proxy)return this.getProxy().tbjStatus(tbjStatus);  this.put("tbjStatus", tbjStatus);return this;};
	/** and tbj_status is null */
	this.tbjStatusNull=function(){if(this.proxy)return this.getProxy().tbjStatusNull();if(this.get("tbjStatusNot")==null)this.put("tbjStatusNot", "");this.put("tbjStatus", null);return this;};
	/** not .... */
	this.tbjStatusNot=function(){if(this.proxy)return this.getProxy().tbjStatusNot();this.put("tbjStatusNot", "not");return this;};
	this.tbjStatusNotNull=function(){if(this.proxy)return this.getProxy().tbjStatusNotNull();this.put("tbjStatusNot", "not");this.put("tbjStatus", null);return this;};
	this.tbjStatusNot=function(tbjStatus){if(this.proxy)return this.getProxy().tbjStatusNot(tbjStatus);this.put("tbjStatusNot", "not");this.put("tbjStatus", tbjStatus);return this;};
	this.tbjStatusIn=function(ids){
		if(this.proxy)return this.getProxy().tbjStatusIn(ids);  this.put("tbjStatusIn", ids);return this;
	};	
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有经销商 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/business/jxsh.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取经销商分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/business/jxsh.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取经销商 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/business/jxsh.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

TbJxsh.get = function(id){
	var protocol = ux.ajax("/admin/business/jxsh.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.tbJxsh;
	return null;
}

TbJxsh.where = new TbJxsh.Where(0,true);